Skip to content

feat: Custom events & optimizations#159

Merged
Nonolanlan1007 merged 47 commits intomasterfrom
feat/custom-events
Dec 17, 2025
Merged

feat: Custom events & optimizations#159
Nonolanlan1007 merged 47 commits intomasterfrom
feat/custom-events

Conversation

@ValDesign22
Copy link
Copy Markdown
Member

@ValDesign22 ValDesign22 commented Apr 24, 2025

Warning

Don't merge the pull request because the api is currently not compatible with the new custom events

This pull request introduces significant updates to the discord-analytics package, including a migration to a monorepo structure, implementation of a new core package, and updates to documentation and configuration files. The changes aim to improve modularity, enhance functionality, and provide better documentation for users.

Monorepo Migration and Core Package Introduction:

  • package.json: Transitioned the project to a monorepo structure by introducing workspaces and removing unnecessary dependencies and scripts. Updated the package metadata to reflect the new structure.
  • packages/core/package.json: Added a new core package (@discordanalytics/core) as part of the monorepo structure. This package serves as the foundational library for working with Discord Analytics.
  • packages/core/src/index.ts: Implemented the core functionality for discord-analytics, including the AnalyticsBase class for API interactions, custom event tracking, and guild statistics management.
  • packages/core/src/types.ts: Added new types (LocaleData, GuildsStatsData) and updated constants for better API endpoint management and error handling. [1] [2]

Documentation Updates:

  • README.md: Updated the documentation to reflect the new initialization process (analytics.init()), corrected outdated links to the new documentation site, and improved clarity for users. [1] [2] [3] [4]

Dependency and Configuration Updates:

@ValDesign22
Copy link
Copy Markdown
Member Author

Warning

Don't merge the pull request because the api is currently not compatible with the new custom events

Copy link
Copy Markdown
Member

@Nonolanlan1007 Nonolanlan1007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Il faut faire gaffe, la plupart de mes review concernent l'ensemble du package, donc j'ai pas répété le commentaire à chaque fois.
De plus, il probablement modifier les fichiers de tests

Copy link
Copy Markdown
Member Author

j'ai pas edit les tests car je sais que tu vas tester plus tard

@Nonolanlan1007 Nonolanlan1007 added the enhancement New feature or request label Apr 24, 2025
…s, discord.js-light, eris, oceanic) with tracking capabilities

- Implemented core analytics functionality in @discordanalytics/core
- Created @discordanalytics/discordjs, @discordanalytics/discordjs-light, @discordanalytics/eris, and @discordanalytics/oceanic packages
- Added event tracking for interactions, guild creation, and deletion
- Included API integration for sending analytics data
- Configured TypeScript support and package.json for each library
- Established a pnpm workspace for better package management
Copy link
Copy Markdown
Member Author

Faudra update les tokens npm pour que le npm publish work sans problème

@Nonolanlan1007
Copy link
Copy Markdown
Member

Yep, il faut que je réfléchisse à comment je vais faire. Autant pour le monorepo, que pour le token (si je dis pas de bêtises, on peut plus en avoir un à durée indéfinie).

Copy link
Copy Markdown
Member Author

Copy link
Copy Markdown
Member Author

euh, y a pas l'air d'avoir de prob si je mets un token qui dure 1 an 😅

image.png

Copy link
Copy Markdown
Member Author

ah nop, pour write access c'est 90 days maxi

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request introduces a significant architectural change by migrating the discord-analytics package to a monorepo structure. The update includes the implementation of a new core package, custom events functionality, and various optimizations to improve modularity and maintainability.

Key Changes:

  • Migration to monorepo structure with separate packages for each Discord library
  • Introduction of @discordanalytics/core package containing base functionality
  • Implementation of custom events tracking with increment/decrement/set operations
  • Updated API with retry logic and better error handling
  • New testing infrastructure using Vitest

Reviewed changes

Copilot reviewed 49 out of 53 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
packages/core/src/index.ts Core analytics functionality including custom events and base class
packages/core/src/types.ts Type definitions and constants for the core package
packages/oceanic/src/index.ts Oceanic.js wrapper implementation
packages/eris/src/index.ts Eris wrapper implementation
packages/discordjs/src/index.ts Discord.js wrapper implementation
packages/discordjs-light/src/index.ts Discord.js-light wrapper implementation
vitest.config.ts & vitest.workspace.ts Testing configuration for the monorepo
.github/workflows/ci.yml Updated CI workflow for testing
package.json Root package configuration for monorepo
pnpm-workspace.yaml Workspace configuration for pnpm
Files not reviewed (2)
  • packages/core/pnpm-lock.yaml: Language not supported
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Nonolanlan1007 Nonolanlan1007 merged commit f1fe949 into master Dec 17, 2025
5 checks passed
@Nonolanlan1007 Nonolanlan1007 deleted the feat/custom-events branch December 17, 2025 17:37
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 2.6.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants